#include<iostream>
using namespace std;
int main(void)
{
	int a, b, count = 0;
	for (int i = 123; i <= 329; i++)
	{
		a = i * 2;
		b = i * 3;
		int f[10] = { 0 };
		f[i / 100] = 1;
		f[i / 10 % 10] = 1;
		f[i % 10] = 1;
		f[a / 100] = 1;
		f[a / 10 % 10] = 1;
		f[a % 10] = 1;
		f[b / 100] = 1;
		f[b / 10 % 10] = 1;
		f[b % 10] = 1;
		count = 0;
		for (int j = 1; j <= 9; j++)if (f[j] == 1)count++;
		if (count == 9)cout << i << ' ' << a << ' ' << b << endl;
	}
	return 0;
}